<extend name="Public/content" />
<block name="style">
<style type="text/css">
    .table>tbody>tr>td{ padding: 4px; vertical-align: middle;}
        body{ background: #fff;}
</style>
</block>
<block name="body">
    <form action="{:U('Nav/add_menu')}" method="post" id="searchForm">
        <input type="hidden" name="parent_id" value="0" id="parent_id">
    <include file="Public:artdialog" />
    <div class="row">
        <div class="col-md-12">
            <div class="block-web">
                <div class="header">
                    <h3 class="content-header">菜单列表</h3>
                </div>

                <div class="porlets-content">
                    <div class="table-responsive">
                        <div id="order_list_item_content">
                            <div class="item-list-bd" style="height:100px;line-height:100px;text-align:center;">
                                <img src="/Public/Admin/images/load3.gif" />
                                加载中...
                            </div>
                        </div>
                    </div><!--/table-responsive-->
                </div><!--/porlets-content-->
            </div><!--/block-web-->
        </div><!--/col-md-12-->
    </div>
</form>
    <div class="footer" >
        <button class="btn btn-default bt_close" type="button" onclick="art.dialog.open.api.close();" >关闭</button>
    </div>
</block>
<block name="script">
<script type="text/javascript">
    $(function(){
        goSearch("#searchForm","order_list_item_content");
    });

    function load(){
        goSearch("#searchForm","order_list_item_content");
    }

    function toParentChilder(id){
        $('#parent_id').val(id);
        goSearch("#searchForm","order_list_item_content");
    }


    function delete_ok(id){
        art.dialog({
            content: "是否确认删除，如果是会自动删除关联数据",
            icon: 'question',
            lock: true,
            opacity: 0.2,
            id:'dele',
            ok: function () {
                var url="{:U('Nav/delete_ok')}";
                $.ajax({
                    'url':url,
                    'data':{id:id},
                    'dataType':'json',
                    'type':'post',
                    success:function(data){

                        goSearch("#searchForm","order_list_item_content");

                        //_reload_currentpage_datalist('order_list_item_content');
                        // goSearch("#searchForm","order_list_item_content");
                        var retstatus = data.status == 1 ? "1" : "0";
                        showvfmsg(retstatus, data.info, 1900);

                    },error:function(){
                        showvfmsg('error','请求服务器失败',2000);
                    },complete:function(){

                    }
                });


            },
            cancelVal: '取消',
            cancel: true
        });
    }


    function return_main(){
        $("#parent_id").val(0);
        goSearch("#searchForm","order_list_item_content");
    }

</script>
</block>